<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <!-- <script src="ajax.js"></script>
    <script src="user.js"></script> -->
    <script src="login.js" type="module"></script>
</head>
<body>
    <form action="" onsubmit="return false">
        <p>用户名：<input type="text" name="" id="user_name"><span></span></p>
        <p>密&emsp;码：<input type="password" name="" id="user_pwd"><span></span></p>
        <!-- <p>手机名：<input type="text" name="" id="user_phone"><span></span></p> -->
        <p><input type="submit" value="登录" id="button"><span></span></p>
    </form>
    <!-- <script>
    var nameInp=document.getElementById("user_name")
    var namespan=nameInp.nextElementSibling;
    var pwdInp=document.getElementById("user_pwd")
    var pwdspan=pwdInp.nextElementSibling
    var btn=document.getElementById("button")
    btn.onclick=function(){
       if(nameInp.value&&pwdInp.value){
        userlist.login(nameInp.value,pwdInp.value).then(function(result){
             if(result.status){
                 localStorage.setItem("user",result.user)
                 localStorage.setItem("user_id",result.id)
                 localStorage.setItem("pwd",result.pwd)
                 var backurl=localStorage.getItem("backurl")
                 if(backurl){
                     localStorage.removeItem("backurl")
                     location.href=backurl;
                 }
                 else{
                    location.href="index.html"
                 }
             }
             else{
               alert("用户名或密码错误")
             }
        })
       }
    }
    </script> -->
</body>
</html>